package com.tenebrous.jestic.mapper.idao.framwork.system;

import com.tenebrous.jestic.entity.framwork.system.SysNotice;
import com.tenebrous.jestic.mapper.ISuperMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//@Mapper
public interface SysNoticeMapper extends ISuperMapper<SysNotice> {

    List<SysNotice> selectByCondition(@Param("stype") String stype, @Param("title") String title, @Param("published") Integer published, @Param("userid") String userid);

    Integer selectUnreadCount(@Param("userid") String userid);

    @Select("SELECT COUNT(*) FROM SYS_NOTICE_READ A WHERE A.NOTICEID=#{noticeid} AND A.CREATE_USERID=#{userid}")
    Integer selectUserReadedCount(@Param("noticeid") String noticeid, @Param("userid") String userid);
}